package com.zxl.working.mapper.backend;

import com.zxl.working.entity.backend.SellerAccount;
import com.zxl.working.entity.backend.SellerAccountDetails;
import org.apache.ibatis.annotations.*;
import org.springframework.beans.factory.annotation.Qualifier;

import java.util.List;

@Mapper
@Qualifier("backEndSqlSessionTemplate")
public interface SellerAccountDetailMapper {

    @Select("SELECT sa.seller_account_id FROM seller_account sa where sa.seller_id = #{sellerId} limit 1")
    String qrySellerAccount(@Param("sellerId")String sellerId);



    @Insert("INSERT INTO `backend`.`seller_account_detail`(`trade_id`,`seller_account_id`,  `trade_serial`,  `order_source`,  `oper_type`," +
            "  `pay_time`,  `pay_subject`,  `pay_type`,  `trade_money`,  `trade_comment`,  `is_total`,  `total_time`," +
            "  `cpm_time`,  `seller_id`,  `service_id`) values(" +
            " #{tradeId},#{sellerAccountId},#{tradeSerial}," +
            " #{orderSource},#{operType},#{payTime},#{paySubject}," +
            " #{payType},#{tradeMoney},#{tradeComment},#{isTotal}," +
            " #{totalTime},#{cpmTime},#{sellerId},#{serviceId})")
    int insertSellerAccountDetail(SellerAccountDetails sellerAccountDetails);

}
